//可选参数
function buildName(firstName: string, lastName?: string) {
  if (lastName){
    return firstName + " " + lastName;
}else{
    return firstName;
}
}

console.log(buildName('z'));
console.log(buildName('z','s'));

//无返回值
function eachArr(arr:number[]):void{
  arr.forEach((item)=>{
    console.log(item);
  })
}

const res = eachArr([1,2,3,4,5]);
console.log('??',res);